<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/common.jsp"></jsp:include>
<title>登录页面</title>
<script type="text/javascript">
	Ext.onReady(function(){
		var form = new Ext.form.FormPanel({
			id : 'form',
			baseCls : 'x-plain',
			labelWidth : 55,
			defaultType : 'textfield',
			items : [ {
				xtype : 'hidden',
				name : 'id'
			}, {
				fieldLabel : '姓名',
				name : 'name',
				anchor : '50%',
			}, {
				xtype : 'numberfield',
				fieldLabel : '密码',
				name : 'passwd',
				anchor : '50%'
			}, {
				xtype : 'combo',
				fieldLabel : '角色',
				store : [ '学生', '老师' ],
				name : 'sex',
				mode : 'local',
				editale : true,
				triggerAction : 'all',
				/* value:0, */
				anchor : '50%'
			} ]
		});
		var window = new Ext.Window({
			title : '登录',
			width : 400,
			height : 150,
			closable:false,
			resizable:false,
			plain : true,
			closeAction : 'hide',
			bodyStyle : 'padding:5px',
			buttonAlign : 'center',
			items : [ form ],
			buttons : [
					{
						text : '登录',
						handler : function() {
							Ext.getCmp('form').getForm().submit(
									{
										waitMsg : '正在提交数据',
										waitTitle : '提示',
										url : basePath
												+ 'home.html?login',
										method : 'post',
										success : function(form, action) {
											//Ext.Msg.alert('提示', '保存成功');
											window.hide();
											document.location.href=basePath+'home.html?home';
										},
										failure : function(form, action) {
											Ext.Msg.alert('提示', '原因如下：'
													+ action.result.errors);
										}
									});
						}
					}, {
						text : '重置',
						handler : function() {
							Ext.getCmp('form').getForm().reset();
						}
					} ]
		});
		window.show();
	});
</script>
</head>
<body>
</body>
</html>